/*
 * @Author: Administrator
 * @Date:   2018-01-05 08:52:23
 * @Last Modified by:   Administrator
 * @Last Modified time: 2018-02-05 16:02:44
 */
// 技术文章


import TA from './technical_article'
// 微信推荐
import WR from './weichat_recommend'
// 程序员笑话
import PJ from './programmer_joke'
// 文章详情
import RD from './article_detail'
// 用户
import User from './user_store'

const initialState = process.env.RENDER_METHOD !== 'server' ? window.__INITIAL_STATE__ || {} : {}
const userInfo = process.env.RENDER_METHOD !== 'server' ? window.__USER_INFO__ || {} : {}
const createStore = () => {
  const stores = {
    ta: new TA(initialState),
    wr: new WR(initialState),
    pj: new PJ(initialState),
    rd: new RD(initialState),
  }
  return stores
}

const createUserStore = (user = userInfo) => {
  const userStore = new User(user)
  return userStore
}
export {
  createStore,
  createUserStore,
}
